package com.example.springbootdemo.mapper;

import com.example.springbootdemo.bean.Security;
import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

public interface SecurityMapper {
    @Insert({
        "insert into security (fund_name, manager_name, ",
        "mandator_name, establish_date, ",
        "putonrecord_ate)",
        "values (#{fundName,jdbcType=VARCHAR}, #{managerName,jdbcType=VARCHAR}, ",
        "#{mandatorName,jdbcType=VARCHAR}, #{establishDate,jdbcType=VARCHAR}, ",
        "#{putOnRecordDate,jdbcType=VARCHAR})"
    })
    int insert(Security.ContentBean record);

    @Select({
        "select",
        "fund_name, manager_name, mandator_name, establish_date, putonrecord_ate",
        "from security"
    })
    @Results({
        @Result(column="fund_name", property="fundName", jdbcType=JdbcType.VARCHAR),
        @Result(column="manager_name", property="managerName", jdbcType=JdbcType.VARCHAR),
        @Result(column="mandator_name", property="mandatorName", jdbcType=JdbcType.VARCHAR),
        @Result(column="establish_date", property="establishDate", jdbcType=JdbcType.VARCHAR),
        @Result(column="putonrecord_ate", property="putonrecordAte", jdbcType=JdbcType.VARCHAR)
    })
    List<Security> selectAll();
}